package demo01;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class work06 {
	public static void main(String[] args) {
		int [] arr1= {1,2,3};
		int [] arr2 = {2,3,4,5};
		List<Integer> intList = Arrays.stream(arr1)
				.boxed()
				.collect(Collectors.toList());
		List<Integer> intList2 = Arrays.stream(arr2)
				.boxed()
				.collect(Collectors.toList());;
		List<Integer> out = Arrays.stream(arr2)
				.boxed().filter(intList::contains)
				.collect(Collectors.toList());
		intList.addAll(intList2);

		List<Integer> end = intList.stream().
				filter(s->out.contains(s)==false)
				.collect(Collectors.toList());
		System.out.println(end);
	}
}
